const one = 5;
function makeBindPoint(item) {
    return new BindPoint(item[0]*one, item[1]*one);
}
class Skeleton1 {
    constructor(arr, interval, xDis, yDis) {
        this.skeleton = {
            neck1: makeBindPoint(arr[0]),
            neck2: makeBindPoint(arr[1]),
            leftHand1: makeBindPoint(arr[2]),
            leftHand2: makeBindPoint(arr[3]),
            rightHand1: makeBindPoint(arr[4]),
            rightHand2: makeBindPoint(arr[5]),
            body1: makeBindPoint(arr[6]),
            body2: makeBindPoint(arr[7]),
            leftLeg1: makeBindPoint(arr[8]),
            leftLeg2: makeBindPoint(arr[9]),
            rightLeg1: makeBindPoint(arr[10]),
            rightLeg2: makeBindPoint(arr[11]),
            sword: makeBindPoint(arr[12])
        }
        this.skeleton.body1.children = [this.skeleton.neck2, this.skeleton.body2];
        this.skeleton.neck2.children = [this.skeleton.neck1, this.skeleton.leftHand1, this.skeleton.rightHand1];
        this.skeleton.leftHand1.children = [this.skeleton.leftHand2];
        this.skeleton.rightHand1.children = [this.skeleton.rightHand2];
        this.skeleton.leftHand2.children = [this.skeleton.sword];
        this.skeleton.body2.children = [this.skeleton.leftLeg1, this.skeleton.rightLeg1];
        this.skeleton.leftLeg1.children = [this.skeleton.leftLeg2];
        this.skeleton.rightLeg1.children = [this.skeleton.rightLeg2];
        this.interval = interval;
        this.xDis = xDis;
        this.yDis = yDis;
        this.x = 0;
        this.y = 0;
    }
    setPos(x, y) {
        this.x = x;
        this.y = y;
    }
    copy(s) {
        Object.keys(this.skeleton).forEach((key) => {
            if (this.skeleton[key] && s.skeleton[key]) {
                this.skeleton[key].x = s.skeleton[key].x;
                this.skeleton[key].y = s.skeleton[key].y;
            }
        });
        this.x = s.x;
        this.y = s.y;
    }
}